<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户详情 - 威客任务平台</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="container">
            <a class="navbar-brand" href="/">威客任务平台</a>
            <div class="navbar-nav ms-auto">
                <a class="nav-link" th:href="@{/dashboard}">仪表板</a>
                <a class="nav-link" th:href="@{/admin/users}">用户管理</a>
                <a class="nav-link" th:href="@{/logout}">退出</a>
            </div>
        </div>
    </nav>

    <div class="container mt-4">
        <h2>用户详情</h2>
        
        <div class="card">
            <div class="card-body">
                <h5 class="card-title" th:text="${user.username}"></h5>
                <p class="card-text">
                    <strong>用户ID:</strong> <span th:text="${user.userId}"></span><br>
                    <strong>邮箱:</strong> <span th:text="${user.email}"></span><br>
                    <strong>手机号:</strong> <span th:text="${user.phone}"></span><br>
                    <strong>角色:</strong> 
                    <span th:if="${user.role == 'admin'}" class="badge bg-danger">管理员</span>
                    <span th:if="${user.role == 'employer'}" class="badge bg-primary">雇主</span>
                    <span th:if="${user.role == 'freelancer'}" class="badge bg-success">威客</span>
                    <br>
                    <strong>创建时间:</strong> <span th:text="${#temporals.format(user.createTime, 'yyyy-MM-dd HH:mm')}"></span><br>
                    <strong>更新时间:</strong> <span th:text="${#temporals.format(user.updateTime, 'yyyy-MM-dd HH:mm')}"></span><br>
                </p>
                <a th:href="@{/admin/users}" class="btn btn-primary">返回用户列表</a>
                <a th:href="@{/admin/users/edit/{id}(id=${user.userId})}" class="btn btn-warning">编辑用户</a>
                <a th:href="@{/admin/users/delete/{id}(id=${user.userId})}" 
                   class="btn btn-danger"
                   onclick="return confirm('确定要删除这个用户吗？')">删除用户</a>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>